function checkImageFile(id){
	var elem=document.getElementById(id);
    var filePath = elem.value;


    if(filePath.indexOf('.') == -1)
    	elem.value = "";
    

    var validExtensions = new Array();
    var ext = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase();


    validExtensions[0] = 'jpg';
    validExtensions[1] = 'jpeg';
    validExtensions[2] = 'bmp';
    validExtensions[3] = 'png';
    validExtensions[4] = 'gif';


    for(var i = 0; i < validExtensions.length; i++) {
        if(ext == validExtensions[i]){
        	$('#icon_show').attr('src', $(id).attr('value'));
        	 return true;
        }
           
    }


    alert('Định dạng ' + ext.toUpperCase() + ' không hợp lệ!');
    elem.value = "";
}